﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SLASCIICore
{
    public enum Direction
    {
        North,
        East,
        South,
        West
    }
    public static class Walker
    {
        public static int DeltaX(Direction theDirection)
        {
            switch (theDirection)
            {
                case Direction.East:
                    return 1;
                case Direction.West:
                    return -1;
                case Direction.North:
                case Direction.South:
                default:
                    return 0;
            }
        }
        public static int DeltaY(Direction theDirection)
        {
            switch (theDirection)
            {
                case Direction.North:
                    return -1;
                case Direction.South:
                    return 1;
                case Direction.East:
                case Direction.West:
                default:
                    return 0;
            }
        }
        public static Direction Opposite(Direction theDirection)
        {
            switch (theDirection)
            {
                case Direction.North:
                    return Direction.South;
                case Direction.South:
                    return Direction.North;
                case Direction.East:
                    return Direction.West;
                case Direction.West:
                    return Direction.East;
                default:
                    return theDirection;
            }
        }
        public static Direction Next(Direction theDirection)
        {
            switch (theDirection)
            {
                case Direction.North:
                    return Direction.East;
                case Direction.South:
                    return Direction.West;
                case Direction.East:
                    return Direction.South;
                case Direction.West:
                    return Direction.North;
                default:
                    return theDirection;
            }
        }
        public static Direction Previous(Direction theDirection)
        {
            switch (theDirection)
            {
                case Direction.North:
                    return Direction.West;
                case Direction.South:
                    return Direction.East;
                case Direction.East:
                    return Direction.North;
                case Direction.West:
                    return Direction.South;
                default:
                    return theDirection;
            }
        }
    }
}
